﻿@{
    ViewBag.Title = "HzyAdmin .Net MVC5";
    ViewBag.MainPage = "/Admin/Home/Main/";
    ViewBag.LoginPage = AppConfig.LoginPageUrl;
    ViewBag.Out = "/Admin/Login/Out";
}
@section Styles{

}
@section Scripts{

}
<div class="hzy-container" id="hzy-container">
    <header class="hzy-header-skin-blue">
        <div class="hzy-header-left">
            <ul>
                <!--fas fa-indent-->
                <li class="hzy-headerhover" onclick="hzy.menu.toggle();"><a href="javascript:void(0)"><i class="fas fa-outdent"></i></a></li>
                <li class="hzy-headerhover hzy-logo"><a>@ViewBag.Title</a></li>
            </ul>
        </div>
        <div class="hzy-header-right d-none d-lg-block">
            <ul>
                <li class="hzy-headerhover"><a href="/swagger" target="_blank"><i class="fas fa-desktop"></i>&nbsp;&nbsp;进入Swagger</a></li>
                <li class="hzy-headerhover" onclick="hzy.tabs.refreshActive();"><a href="javascript:void(0)"><i class="fas fa-undo"></i></a></li>
                <li class="hzy-headerhover" onclick="$('#examplePositionSidebar').modal()"><a href="javascript:void(0)"><i class="fas fa-layer-group"></i></a></li>
                <!--fa fa-compress-->
                <li class="hzy-headerhover"><a href="javascript:void(0)" onclick="hzy.fullScreen.handleFullScreen(this)"><i class="fas fa-expand"></i></a></li>
                <li class="hzy-headerhover"><a href="@ViewBag.Out">登录人：&nbsp;<span>@ViewBag.UsreName</span>&nbsp;<i class="fas fa-sign-out-alt"></i></a></li>
            </ul>
        </div>
        <div class="hzy-header-right d-lg-none">
            <ul>
                <li class="hzy-headerhover"><a href="@ViewBag.Out"><i class="fas fa-sign-out-alt"></i></a></li>
            </ul>
        </div>
    </header>
    <main>
        <!--menu 菜单-->
        <nav class="hzy-menu sidebar-nav sidebar-nav-max">
            @Html.Raw(ViewBag.Menus)
        </nav>
        <section class="hzy-main-right">
            <!--tabs 选项卡-->
            <nav class="d-none d-lg-block">
                <div class="hzy-left-btn" onclick="hzy.tabs.goLeft(this)"><i class="fa fa-chevron-left"></i></div>
                <div class="hzy-center-menu">
                    <!--横向导航-->
                    <ul>
                        <li class="selected" hzy-router="#!首页#!@ViewBag.MainPage">首页</li>
                    </ul>
                </div>
                <div class="hzy-right-btn" onclick="hzy.tabs.goRight(this)"><i class="fa fa-chevron-right"></i></div>
                <div class="btn-group dropdown pull-left" id="hzy-tools">
                    <button type="button" class="btn btn-outline btn-default dropdown-toggle height-full hzy-navTab-more" id="exampleBulletDropdown2" data-toggle="dropdown" aria-expanded="false"></button>
                    <div class="dropdown-menu dropdown-menu-bullet dropdown-menu-right" aria-labelledby="exampleBulletDropdown2" role="menu" x-placement="bottom-end" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(-135px, 39px, 0px);">
                        <a class="dropdown-item" href="javascript:;" role="menuitem" onclick="hzy.tabs.closeOther()">
                            <i class="fas fa-times"></i> 关闭其他
                        </a>
                        <a class="dropdown-item" href="javascript:;" role="menuitem" onclick="hzy.tabs.closeAll()">
                            <i class="fas fa-power-off"></i> 关闭所有
                        </a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="javascript:;" role="menuitem" onclick="hzy.tabs.refreshActive()">
                            <i class="fas fa-undo"></i> 刷新当前
                        </a>
                    </div>
                </div>
            </nav>
            <!--html 承载容器-->
            <content></content>
        </section>
    </main>
</div>

<!--皮肤模态框-->
<div class="modal fade" id="examplePositionSidebar" aria-hidden="true" aria-labelledby="examplePositionSidebar" role="dialog" tabindex="-1">
    <div class="modal-dialog modal-sidebar modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title">皮肤设置</h3>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label for="exampleInputEmail1">顶部颜色：</label>
                        <div class="row">
                            <div class="col-sm-12 hzy-skin hzy-header-skin-blue" onclick="hzy.header.setSkin('hzy-header-skin-blue')"></div>
                            <div class="col-sm-12 hzy-skin hzy-header-skin-dark" onclick="hzy.header.setSkin('hzy-header-skin-dark')"></div>
                            <div class="col-sm-12 hzy-skin hzy-header-skin-white" onclick="hzy.header.setSkin('hzy-header-skin-white')"></div>
                        </div>

                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1">左侧菜单颜色：</label>
                        <div class="row">
                            <div class="col-sm-12 hzy-skin hzy-skin-default" onclick="hzy.menu.setSkin(hzy.menu.mSkin.default)"></div>
                            <div class="col-sm-12 hzy-skin hzy-skin-white" onclick="hzy.menu.setSkin(hzy.menu.mSkin.white)"></div>
                        </div>

                    </div>
                </form>
            </div>

        </div>
    </div>
</div>

<script type="text/javascript">
    var app = {
        //客户端与服务端保持长连接
        connetct: function () {
            admin.ajax({
                url: "@Url.Action("Connetct")",
                success: function (r) {
                    console.log(r);
                }
            });
        }
    };
    //js路由初始化
    hzyRouter.init(function () {
        hzy.menu.domObject = $('#adminMenu').metisMenu();
        //admin 初始化
        hzy.settings.isIframe = true;
        hzy.init();

        //默认首页
        if (!top.window.location.hash) hzy.loadPage('@ViewBag.MainPage');

        app.connetct();
        setInterval(function () {
            app.connetct();
        }, 1000 * 60);

    });
</script>